
package com.idealighter.game.backpack.handler;

import com.google.inject.Inject;

import com.idealighter.game.backpack.manager.BackpackMgr;
import com.idealighter.game.backpack.message.ReqUseItemMsg;
import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.server.handler.ReqMessageHandler;


@ReqMsgHandler(ModuleMsgIdConstant.Backpack.USE_ITEM)
public class ReqUseItemHandler implements ReqMessageHandler {

  @Inject
  private BackpackMgr backpackMgr;

  @Override
  public ResMessage action(Player player, ReqMessage message) {
    ReqUseItemMsg msg = (ReqUseItemMsg) message;
    backpackMgr.useItem(player, msg.getItemId(), msg.getNum(), msg.getTarget(), msg.getRemark());

    return null;
  }
}
